package com.xbx.zuul;

import com.xbx.zuul.filter.AccessFilter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableZuulProxy
@SpringCloudApplication
@MapperScan("com.xbx.zuul.mapper")
@EnableCaching
@EnableSwagger2
public class XbxZuulApplication {

    public static void main(String[] args) {
        SpringApplication.run(XbxZuulApplication.class, args);
    }

    @Bean
    public AccessFilter accessUserNameFilter() {
        return new AccessFilter();
    }
}
